package com.ssm.util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Lenovo on 2019/11/4.
 */
public class StaticCarFactory {
    private static Map<String ,Car> cars=new HashMap<>();
    static {
        cars.put("nissan",new Car("nissan",300));
        cars.put("bmw",new Car("bmw",500));
    }
    public static Car getCar(String name){
        return cars.get(name);
    }
}
